<h1>Listing registrations</h1>

<table>
  <tr>
		<th>Date</th>
    <th>Start time</th>
    <th>End time</th>
		<th>Student</th>
		<th>Instructor</th>
    <th>Register time</th>
    <th>Cancel time</th>
    <th></th>
    <th></th>
    <th></th>
  </tr>

<% @registrations.each do |registration| %>
  <tr>
		<td><%= registration.timeslot.start_time.to_date.to_s(:rfc822) %></td>
    <td><%= registration.timeslot.start_time.to_s(:time) %></td>
    <td><%= registration.timeslot.end_time.to_s(:time) %></td>
		<td><%= registration.student.full_name %></td>
		<td><%= registration.timeslot.instructor.full_name %></td>
    <td><%= registration.register_time.to_s(:long) %></td>
    <td><%= registration.cancel_time.to_s(:long) unless registration.cancel_time.nil? %></td>
    <td><%= link_to 'Show', registration %></td>
    <td><%= link_to 'Edit', edit_registration_path(registration) %></td>
    <td><%= link_to 'Destroy', registration, confirm: 'Are you sure?', method: :delete %></td>
  </tr>
<% end %>
</table>

<br />

<%= link_to 'New Registration', new_registration_path %>
